Returns current grid selection.

<div class="definition">
    getSelection(returnIndex)
</div>

Returns array.

<h4>Description</h4>

This method returns an array of recids for all currently selected records in the grid. When you add records you need
to provide unique <span class="property">.recid</span> for each record.
<div style="height: 10px"></div>
If <span class="property">returnIndex</span> is set to true, the method will return indexes of selected records
in the <span class="property">.records</span> array instead of their recids.

If you have grid defined in the following way:
<textarea class="javascript">
let grid = new w2grid({
    name    : 'grid',
    columns: [
        { field: 'recid', text: 'ID', size: '50px' },
        { field: 'lname', text: 'Last Name', size: '30%' },
        { field: 'fname', text: 'First Name', size: '30%' },
        { field: 'email', text: 'Email', size: '40%' },
        { field: 'sdate', text: 'Start Date', size: '120px' },
        { field: 'sdate', text: 'End Date', size: '120px' }
    ],
    records: [
        { recid: 1, fname: 'John', lname: 'doe', email: 'vitali@gmail.com', sdate: '1/3/2012' },
        { recid: 2, fname: 'Stuart', lname: 'Motzart', email: 'jdoe@gmail.com', sdate: '2/4/2012' },
        { recid: 3, fname: 'Jin', lname: 'Franson', email: '--', sdate: '4/23/2012' },
        { recid: 4, fname: 'Susan', lname: 'Ottie', email: 'jdoe@gmail.com', sdate: '5/3/2012' },
        { recid: 5, fname: 'Kelly', lname: 'Silver', email: 'jdoe@gmail.com', sdate: '4/3/2012' },
        { recid: 6, fname: 'Francis', lname: 'Gatos', email: 'vitali@gmail.com', sdate: '2/5/2012' }
    ]
});
</textarea>

You can get selected records:
<textarea class="javascript">
console.log( grid.getSelection() );
</textarea>

Please note if you try to get selection in onClick event, you need to:
<textarea class="javascript">
onClick(event) {
    event.onComplete = function () {
        var sel = this.getSelection();
        console.log('selection:', sel);
    }
}
</textarea>